#ifndef INTEROPPROGRESSREPORTER_H
#define INTEROPPROGRESSREPORTER_H

#include "common/logger.h"
#include <cstddef>
#include <functional>
#pragma once

#include "common/constant.h"
#include "InterOpProgressTypes.h"

AMCAX_EXCHANGE_NAMESPACE_BEGIN

namespace InterOp::Reporter{

class UserProgressCallbackClass
{
private:

    size_t _count{ 0 };

public:

    void IncrementCount()
    {
        _count++;
    }

    size_t GetCount()
    {
        return _count;
    }
};



class InterOpProgressReporter
{
public:
    
    ~InterOpProgressReporter() = default;
    static InterOpProgressReporter &GetInstance() ;

    void Reset() ;

    void ProgressCallBack(double iProgress, bool& iAbort)  ;

    //-----------------------------------------------------------------------------------------

    void ProgressCallBackWithUserData(double iProgress, bool& iAbort, void* ipUserData_dt) ;

    //-----------------------------------------------------------------------------------------

    void SetNumParts(int iNumParts)
    {
        _numParts = iNumParts;
    }

    //-----------------------------------------------------------------------------------------

    void setNonMissingParts(size_t iNonMissingParts)
    {
        nonMissingParts = iNonMissingParts;
    }

    //-----------------------------------------------------------------------------------------

    void SetPsDone(bool isDone)
    {
        _psDone = isDone;
    }

    //-----------------------------------------------------------------------------------------

    void SetExportStarts(bool isStart) ;

    void SetReporterProcess(ReporterType &reporter) {
        this->reporterProcess_ = reporter ;
    }

    void SetDataImportStarts(bool isStart)
	{
		_dataImportStarts = isStart;
		if (_dataImportStarts)
			LOG_INFO("\n Importing PMI Level Data\n");
	}
private:
    InterOpProgressReporter();
private:
    bool _psDone;
    
    size_t _numParts;
    size_t nonMissingParts;
    size_t _partsDone;
    int _lastProgress;
    bool _exportStarts;
    bool _dataImportStarts; 

    ReporterType reporterProcess_ ;
};

}

AMCAX_EXCHANGE_NAMESPACE_END
#endif